package com.errol.msgcenterclient.properties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.lang.Nullable;

/**
 * @author zhang xiao bin
 * @version v1.0
 * @date 2021/05/12
 * @since v1.1.0
 **/
@Data
@Configuration
@ConfigurationProperties(prefix = "msgcenter.mq")
public class MsgCenterMqProperties {

    /**
     * 系统运行环境
     */
    @Value("${spring.profiles.active}")
    private String env;

    /**
     * mq 实例参数
     */
    private String accessKey;
    private String secretKey;
    private String nameSrvAddr;
    private String timeoutMillis;
    /**
     * 顺序消费配置
     */
    private ProducerProperties common;
    /**
     * 批量消费（钉钉机器人）配置
     */
    private ProducerProperties dingRobot;

    @Data
    public static class ProducerProperties {
        /**
         * mq 生产者配置
         */
        private String groupId;
        private String topic;
        @Nullable
        private String tag;
    }
}
